<#include "/common/defaultEngine.html"/>
<@pageTheme mark="${config.optimize()?string('true', 'false')}">
<@header title="新增ERP人事借款申请" bodyClass="white-bg"  libs=["prism","bootstrapSelect","ueditor"]/>
<div class="wrapper wrapper-content ibox-content">
    <@form.form id="form-loan-add"  class="form-horizontal">
    <input name="id" value="${bpmErpPersonLoan.id}" type="hidden">
    <div class="form-group">        <label class="col-sm-3 control-label"><@ctx.i18n text = "流水号"/>：
    </label>
        <div class="col-sm-8"><input name="serialNumber" value="${bpmErpPersonLoan.serialNumber?default('')}" class="form-control" type="text" readonly="true">
        </div>
    </div>
    <div class="form-group">        <label class="col-sm-3 control-label"><@ctx.i18n text = "申请人"/>：
    </label>
        <div class="col-sm-8"><input name="applyUsername" value="${bpmErpPersonLoan.applyUsername?default('')}" class="form-control" type="text" readonly="true">
        </div>
    </div>
    <div class="form-group">        <label class="col-sm-3 control-label"><@ctx.i18n text = "原因"/>：
    </label>
        <div class="col-sm-8"><input name="moneyReason" value="${bpmErpPersonLoan.moneyReason?default('')}" class="form-control" type="text" readonly="true">
        </div>
    </div>
    <div class="form-group">        <label class="col-sm-3 control-label"><@ctx.i18n text = "金额"/>：
    </label>
        <div class="col-sm-8"><input name="moneyMoney" value="${bpmErpPersonLoan.moneyMoney?default('')}" class="form-control" type="number" readonly="true">
        </div>
    </div>
    <div class="form-group">        <label class="col-sm-3 control-label"><@ctx.i18n text = "证明"/>：
    </label>
        <div class="col-sm-8">

            <div class="layui-upload">
                <div class="layui-upload-list layui-upList-minHeight uploadpadding">
                    <table class="layui-table">
                        <thead>
                        <tr>
                            <th>文件名</th>
                            <th>大小</th>
                            <th>状态</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody id="demojiazhaoList1">
                        <tr id="upjiazhaoload1"></tr>
                        <#list proof as item>
                        <tr id="upload${item_index}1">
                            <td> ${item.fileName?default("")}</td>
                            <td> ${item.fileSize?default("")}</td>
                            <td>已上传</td>
                            <td>
                                <a class="btn btn-danger btn-sm" href="#" download="${item.url}"><i class="fa fa-download"></i></a>
                            </td>
                        </tr>
                        </#list>
                        </tbody>
                    </table>
                </div>
            </div>

        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label"><@ctx.i18n text = "款项信息备注"/>：</label>
        <div class="col-sm-8">
            <textarea name="moneyMemo" class="form-control" readonly="true">${bpmErpPersonLoan.moneyMemo?default('')}</textarea>
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-3 control-label"><@ctx.i18n text = "还款方式"/>：</label>
        <div class="col-sm-8">
            <@form.select name="moneyRepaymentMethod" dictType="sys_erp_paybackmethod" value="${bpmErpPersonLoan.moneyRepaymentMethod?default('')}"  readOnly="true"  />
        </div>
    </div>
    <div class="form-group">        <label class="col-sm-3 control-label"><@ctx.i18n text = "还款期限"/>：
    </label>
        <div class="col-sm-8"><input name="moneyRepaymentTerm" value="${bpmErpPersonLoan.moneyRepaymentTerm?default('')}" class="form-control" type="text" readonly="true">
        </div>
    </div>
    <div class="form-group">        <label class="col-sm-3 control-label"><@ctx.i18n text = "会计人员"/>：
    </label>
        <div class="col-sm-8"><input name="accountingPersonname" value="${bpmErpPersonLoan.accountingPersonname?default('')}" class="form-control" type="text" readonly="true">
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label"><@ctx.i18n text = "会计审批"/>：</label>
        <div class="col-sm-8">
            <@form.radio name="accountingApproval" dictType="sys_crm_isOrNo" value="${bpmErpPersonLoan.accountingApproval?default('')}" readOnly="true" />
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label"><@ctx.i18n text = "会计备注"/>：</label>
        <div class="col-sm-8">
            <textarea name="accountingRemark" class="form-control" readonly="true">${bpmErpPersonLoan.accountingRemark?default('')}</textarea>
        </div>
    </div>

    <div class="form-group">        <label class="col-sm-3 control-label"><@ctx.i18n text = "审批金额"/>：
    </label>
        <div class="col-sm-8"><input name="accountingApprovalMoney" value="${bpmErpPersonLoan.accountingApprovalMoney?default('')}" class="form-control" type="number" readonly="true">
        </div>
    </div>
    <#if bpmErpPersonLoan.processStatus==2 >
    <div class="form-group">
        <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "财务经理审批"/>：</label>
        <div class="col-sm-8">
            <@form.radio name="managerApproval" dictType="sys_crm_isOrNo" value="${bpmErpPersonLoan.managerApproval?default('1')}" />
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "财务经理备注"/>：</label>
        <div class="col-sm-8">
            <textarea name="managerRemark" class="form-control" required></textarea>
        </div>
    </div>
</#if>
<#if bpmErpPersonLoan.processStatus!=2 >
<div class="form-group">
    <label class="col-sm-3 control-label"><@ctx.i18n text = "财务经理审批"/>：</label>
    <div class="col-sm-8">
        <@form.radio name="managerApproval" dictType="sys_crm_isOrNo" value="${bpmErpPersonLoan.managerApproval?default('')}" readOnly="true" />
    </div>
</div>
<div class="form-group">
    <label class="col-sm-3 control-label"><@ctx.i18n text = "财务经理备注"/>：</label>
    <div class="col-sm-8">
        <textarea name="managerRemark" class="form-control" readonly="true">${bpmErpPersonLoan.managerRemark?default('')}</textarea>
    </div>
</div>

<div class="form-group">
    <label class="col-sm-3 control-label"><@ctx.i18n text = "确认打款"/>：</label>
    <div class="col-sm-8">
        <@form.radio name="payConfirmpay" dictType="sys_crm_isOrNo" value="${bpmErpPersonLoan.payConfirmpay?default('')}" readOnly="true" />
    </div>
</div>
<div class="form-group confirmClass">
    <label class="col-sm-3 control-label"><@ctx.i18n text = "打款日期"/>：</label>
    <div class="col-sm-8">
        <div class="input-group date">
            <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
            <input class="form-control" name="payPaymentdate"  data-type="date"   value="${(bpmErpPersonLoan.payPaymentdate?string('yyyy-MM-dd'))!}" readonly="true" type="text" />
        </div>
    </div>
</div>
<div class="form-group confirmClass">
    <label class="col-sm-3 control-label"><@ctx.i18n text = "偏好付款方式"/>：</label>
    <div class="col-sm-8">
        <@form.select name="payPreferencePaymethod" dictType="sys_erp_first_paymethod" value="${bpmErpPersonLoan.payPreferencePaymethod?default('')}" readOnly="true"  />
    </div>
</div>
<div class="form-group confirmClass">
    <label class="col-sm-3 control-label"><@ctx.i18n text = "付款方式备注"/>：</label>
    <div class="col-sm-8">
        <textarea name="payMethodMemo" class="form-control" readonly="true">${bpmErpPersonLoan.payMethodMemo?default('')}</textarea>
    </div>
</div>

<div class="form-group confirmClass">        <label class="col-sm-3 control-label"><@ctx.i18n text = "附件"/>：
</label>
    <div class="col-sm-8">

        <div class="layui-upload">
            <div class="layui-upload-list layui-upList-minHeight uploadpadding">
                <table class="layui-table">
                    <thead>
                    <tr>
                        <th>文件名</th>
                        <th>大小</th>
                        <th>状态</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody id="demojiazhaoList">
                    <tr id="upjiazhaoload"></tr>
                    <#list proofList as item>
                    <tr id="upload${item_index}">
                        <td> ${item.fileName?default("")}</td>
                        <td> ${item.fileSize?default("")}</td>
                        <td>已上传</td>
                        <td>
                            <a class="btn btn-danger btn-sm" href="#" download="${item.url}"><i class="fa fa-download"></i></a>
                        </td>
                    </tr>
                    </#list>
                    </tbody>
                </table>
            </div>
        </div>

    </div>
</div>
<div class="form-group confirmClass">        <label class="col-sm-3 control-label"><@ctx.i18n text = "证明"/>：
</label>
    <div class="col-sm-8"><input name="payProof" value="${bpmErpPersonLoan.payProof?default('')}" class="form-control" type="text" readonly="true">
    </div>
</div>
<div class="form-group checkClass">        <label class="col-sm-3 control-label"><@ctx.i18n text = "接收人名称"/>：
</label>
    <div class="col-sm-8"><input name="payRecipientName" value="${bpmErpPersonLoan.payRecipientName?default('')}" class="form-control" type="text" readonly="true">
    </div>
</div>
<div class="form-group checkClass">        <label class="col-sm-3 control-label"><@ctx.i18n text = "接收人地址"/>：
</label>
    <div class="col-sm-8"><input name="payRecipientAddress" value="${bpmErpPersonLoan.payRecipientAddress?default('')}" class="form-control" type="text" readonly="true">
    </div>
</div>
<div class="form-group checkClass">        <label class="col-sm-3 control-label"><@ctx.i18n text = "接收人手机"/>：
</label>
    <div class="col-sm-8"><input name="payRecipientPhone" value="${bpmErpPersonLoan.payRecipientPhone?default('')}" class="form-control" type="text" readonly="true">
    </div>
</div>
<div class="form-group wireClass">        <label class="col-sm-3 control-label"><@ctx.i18n text = "金额"/>：
</label>
    <div class="col-sm-8"><input name="payAccountNumber" value="${bpmErpPersonLoan.payAccountNumber?default('')}" class="form-control" type="number" readonly="true">
    </div>
</div>
<div class="form-group wireClass">        <label class="col-sm-3 control-label"><@ctx.i18n text = "汇款路径号码"/>：
</label>
    <div class="col-sm-8"><input name="payRoutingNumber" value="${bpmErpPersonLoan.payRoutingNumber?default('')}" class="form-control" type="text" readonly="true">
    </div>
</div>
<div class="form-group wireClass">        <label class="col-sm-3 control-label"><@ctx.i18n text = "开户行"/>：
</label>
    <div class="col-sm-8"><input name="payBankAddress" value="${bpmErpPersonLoan.payBankAddress?default('')}" class="form-control" type="text" readonly="true">
    </div>
</div>
<div class="form-group rmbClass">
    <label class="col-sm-3 control-label"><@ctx.i18n text = "人民币汇款"/>：</label>
    <div class="col-sm-8">
        <@form.radio name="payRmbRemittanceMethod" dictType="sys_crm_isOrNo" value="${bpmErpPersonLoan.payRmbRemittanceMethod?default('')}" readOnly="true" />
    </div>
</div>
<div class="form-group rmbClassMoney">        <label class="col-sm-3 control-label"><@ctx.i18n text = "银行名称"/>：
</label>
    <div class="col-sm-8"><input name="payBankName" value="${bpmErpPersonLoan.payBankName?default('')}" class="form-control" type="text" readonly="true">
    </div>
</div>
<div class="form-group rmbClassMoney">        <label class="col-sm-3 control-label"><@ctx.i18n text = "银行账号"/>：
</label>
    <div class="col-sm-8"><input name="payBankAccount" value="${bpmErpPersonLoan.payBankAccount?default('')}" class="form-control" type="text" readonly="true">
    </div>
</div>
<div class="form-group rmbClassMoney">        <label class="col-sm-3 control-label"><@ctx.i18n text = "账户名称"/>：
</label>
    <div class="col-sm-8"><input name="payAccountName" value="${bpmErpPersonLoan.payAccountName?default('')}" class="form-control" type="text" readonly="true">
    </div>
</div>
<div class="form-group">
    <label class="col-sm-3 control-label"><@ctx.i18n text = "付款结果"/>：</label>
    <div class="col-sm-8">
        <@form.radio name="cashierPaymentResult" dictType="sys_crm_isOrNo" value="${bpmErpPersonLoan.cashierPaymentResult?default('')}" readOnly="true" />
    </div>
</div>
<div class="form-group">
    <label class="col-sm-3 control-label"><@ctx.i18n text = "出纳日期"/>：</label>
    <div class="col-sm-8">
        <div class="input-group date">
            <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
            <input class="form-control" name="cashierDate"  data-type="date"   value="${(bpmErpPersonLoan.cashierDate?string('yyyy-MM-dd'))!}" readonly="true" type="text" />
        </div>
    </div>
</div>
<div class="form-group">        <label class="col-sm-3 control-label"><@ctx.i18n text = "接收人编号"/>：
</label>
    <div class="col-sm-8"><input name="cashierReceiptNumber" value="${bpmErpPersonLoan.cashierReceiptNumber?default('')}" class="form-control" type="text" readonly="true">
    </div>
</div>
<div class="form-group">        <label class="col-sm-3 control-label"><@ctx.i18n text = "出纳证明"/>：
</label>
    <div class="col-sm-8"><input name="cashierProof" value="${bpmErpPersonLoan.cashierProof?default('')}" class="form-control" type="text" readonly="true">
    </div>
</div>
<div class="form-group">
    <label class="col-sm-3 control-label"><@ctx.i18n text = "出纳备注"/>：</label>
    <div class="col-sm-8">
        <textarea name="cashierMemo" class="form-control" readonly="true">${bpmErpPersonLoan.cashierMemo?default('')}</textarea>
    </div>
</div>

<div class="form-group">
    <label class="col-sm-3 control-label"><@ctx.i18n text = "出纳提交时间"/>：</label>
    <div class="col-sm-8">
        <div class="input-group date">
            <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
            <input class="form-control" name="cashierSubmitTime"  data-type="date"   value="${(bpmErpPersonLoan.cashierSubmitTime?string('yyyy-MM-dd HH:mm:ss'))!}" type="text"  readonly="true"/>
        </div>
    </div>
</div>
</#if>

<input id="processStatus" type="hidden" value="${bpmErpPersonLoan.processStatus?default('')}">
</@form.form>
</div>
<@footer>
<script type="text/javascript">
    $(function () {
        var processStatusValue = $("#processStatus").val();
        if (processStatusValue == "1") {
            setHidden();
        } else if (processStatusValue == "2") {
            setHidden();
        } else if (processStatusValue == "3") {
            setHidden();
        }else if (processStatusValue == "4") {
            setHidden();
        }
        else if (processStatusValue == "5") {
            setHidden();
        }
    })
    function setHidden(){
        var payConfirmpayValue = $("[name='payConfirmpay']")[0].checked;
        if(payConfirmpayValue){
            $(".confirmClass").show();
            setSelectHidden();
        }
        else{
            $(".confirmClass").hide();
            $(".checkClass").hide();
            $(".wireClass").hide();
            $(".rmbClass").hide();
            $(".rmbClassMoney").hide();
        }

    }

    function setSelectHidden(){
        var payPreferencePaymethodValue=$("[name='payPreferencePaymethod']").val();

        if(payPreferencePaymethodValue=="1"){
            $(".checkClass").show();
            $(".wireClass").show();
            $(".rmbClass").hide();
            $(".rmbClassMoney").hide();
        }
        else if(payPreferencePaymethodValue=="2"){
            $(".checkClass").hide();
            $(".wireClass").show();
            $(".rmbClass").hide();
            $(".rmbClassMoney").hide();
        }
        else if(payPreferencePaymethodValue=="3"){
            $(".checkClass").hide();
            $(".wireClass").hide();
            $(".rmbClass").show();
            if($("[name='payRmbRemittanceMethod']")[0].checked){
                $(".rmbClassMoney").show();
            }
            else{
                $(".rmbClassMoney").hide();
            }
        }
        else{
            $(".checkClass").hide();
            $(".wireClass").hide();
            $(".rmbClass").hide();
            $(".rmbClassMoney").hide();
        }
    }
    var prefix = baseURL + "erp/loan"
    $("#form-loan-add").validate({
        focusCleanup: true
    });
    function submitHandler() {
        if (opt.validate.form()) {
            opt.operate.save(prefix + "/view3", $('#form-loan-add').serialize());
        }
    }
</script>
</@footer>
</@pageTheme>